<?php $this->load->view(TEMPLATE_NAME.'/admin/header');?>
<?php $this->load->view(TEMPLATE_NAME.'/admin/side_left');?>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery.validate.pack.js"></script>
<script>
$(document).ready(function(){
    $('#home_info_form').validate({
        rules : {
            adult_count : "required",    
            children_count : "required",
            pensioner_count : "required",
            household_income : "required",
            house_type : "required",
            house_ownership : "required"
        },
	messages : {
            adult_count : "Please Select the number of adult",    
            children_count : "Please Select the number of children",
            pensioner_count : "Please Select the number of pensioner",
            household_income : "Please Select the household income",
            house_type : "Please Select the house type",
            house_ownership : "Please Select the ownership"
	}
    });                  
});
</script>
<div class="page noright adminpage adminuser">
    
    <?php $this->load->view(TEMPLATE_NAME.'/admin/profile/profile_tabs');?>
    <h2 class="no">Your Home/Household Info</h2>   
    <p class="black f13"><strong>Private and Confidential</strong>. All information here is <strong>not shared</strong> and is treated highly confidentially.<br /> 
    Information is simply aggregated to create a rough impression of the network and to allow decision makers to gain a better understanding of the area. This data serves as a more up-to-date census of the area in question.<br />
    Information from this section will only ever be presented as a group average. Under no circumstances will individual data ever be revealed.</p>
<?php if(!empty($notification)): ?>
<p><?php echo $notification ?></p>
<?php endif; ?>

    <hr />
    
    <?php echo form_open('admin/profile/home_info',array('method' => 'post', 'class' => 'formstep formp', 'id' => 'home_info_form'));?>
    <p class="nop ">Number of people living in your household <span class="purple norm">(all information is confidential)</span></p>    
    <p><label class="w270" >Number of <strong>adults</strong> in your household: <span class="purple">*</span></label> 
    <select name="adult_count">
    <option value="">None</option>
    <?php
    for ($i=0; $i<=10; $i++){
        echo "<option value='".$i."'";
        if ($i == $home_info['adult_count']){
            echo "selected='selected' ";
        }
        echo ">".$i."</option>";    
    }
    ?>
    </select> <span class="purple">(Over 18 years old)</span>        
    <?php echo form_error('adult_count') ?>       
    </p>
    <p><label class="w270" >Number of <strong>children</strong> in your household: <span class="purple">*</span></label> 
    <select name="children_count">
    <option value="">None</option>
    <?php
    for ($j=0; $j<=10; $j++){
        echo "<option value='".$j."'";
        if ($j == $home_info['children_count']){
            echo "selected='selected' ";
        }
        echo ">".$j."</option>";    
    }
    ?>
    </select> <span class="purple">(18 years old or younger)</span>       
    <?php echo form_error('children_count') ?>       
    </p>
    <p><label class="w270" >Number of <strong>pensioners</strong> in your household: <span class="purple">*</span></label> 
    <select name="pensioner_count">
    <option value="">None</option>
    <?php
    for ($k=0; $k<=10; $k++){
        echo "<option value='".$k."'";
        if ($k == $home_info['pensioner_count']){
            echo "selected='selected' ";
        }
        echo ">".$k."</option>";    
    }
    ?>
    </select> <span class="purple">(Over 65 years old)</span>       
    <?php echo form_error('pensioner_count') ?>       
    </p>    
    <p class="nop ">Income Level <span class="purple norm">(all information is confidential)</span></p>
    <p><label class="w270" ><strong>Household Income (combined total):</strong><span class="purple">*</span></label> 
    <select name="household_income">
    <option value="">Select Income</option>    
    <?php foreach ($income as $row){
        echo "<option value='".$row['income']."' ";
        if($row['income'] == $home_info['household_income']){ echo "selected='selected'";}
        echo ">".$row['income']."</option>";
    }
    ?>
    </select>        
    </p>
    <?php echo form_error('household_income') ?> 
    
    <p class="nop ">Type of accomodation and ownership <span class="purple norm">(all information is confidential)</span></p>
    <p><label class="">House Type:<span class="purple">*</span></label> 
    <input type="radio" name="house_type" <?php if ($home_info['house_type'] == "H"){?>checked="checked"<?php }?> value="H"/> House 
    <input type="radio" name="house_type" <?php if ($home_info['house_type'] == "C"){?>checked="checked"<?php }?> value="C"/> Cluster/Townhouse     
    <input type="radio" name="house_type" <?php if ($home_info['house_type'] == "F"){?>checked="checked"<?php }?> value="F"/> Flat
    <input type="radio" name="house_type" <?php if ($home_info['house_type'] == "I"){?>checked="checked"<?php }?> value="I"/> Informal/Other
    </p>
    <?php echo form_error('house_type') ?>
    <p><label class="">Own or Rent:<span class="purple">*</span></label> 
    <input type="radio" name="house_ownership" <?php if ($home_info['house_ownership'] == "F"){?>checked="checked"<?php }?> value="F"/> 
    Fully owned (paid up in full - with no bond or debt)         
    </p>
    <p><label class="">&nbsp;</label> 
    <input type="radio" name="house_ownership" <?php if ($home_info['house_ownership'] == "B"){?>checked="checked"<?php }?> value="B"/> 
    Owned/Bonded (Curently owned through a bond from bank)         
    </p>
    <p><label class="">&nbsp;</label> 
    <input type="radio" name="house_ownership" <?php if ($home_info['house_ownership'] == "O"){?>checked="checked"<?php }?> value="O"/> 
    Occupied without rent or payment of any type         
    </p>
    <p><label class="">&nbsp;</label> 
    <input type="radio" name="house_ownership" <?php if ($home_info['house_ownership'] == "P"){?>checked="checked"<?php }?> value="P"/> 
    Prefer not to say         
    </p>
    <?php echo form_error('house_ownership') ?>
   <hr /> 
    <?php 
        $form_button = array(
            'type'=>'submit',
            'name'=>'submit',
            'value'=>'submit',
            'content'=>'Submit',
        );
        echo form_button($form_button) ?>
    <div class="clear"></div>
    </form><!-- formstep -->
</div><!-- page -->
<?php $this->load->view(TEMPLATE_NAME.'/admin/footer');?>
